﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Realidad.aspx.cs" Inherits="Realidad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style1
        {
            font-size: large;
            color: #0099FF;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <strong><span class="style1">Bienvenida: Secretaria<br />
    Planificacion y manejo contable JCI femenino Cochabamba<br />
    </span></strong>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
    <br />
RESULTADOS POR MESES<asp:GridView ID="GridView2" runat="server" 
    AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
    BorderStyle="None" BorderWidth="1px" CellPadding="3" 
    DataSourceID="SqlDataSource8" Width="912px">
    <Columns>
        <asp:BoundField DataField="Resultados" HeaderText="Resultados" 
            SortExpression="Resultados" />
        <asp:BoundField DataField="Enero" HeaderText="Enero" SortExpression="Enero" />
        <asp:BoundField DataField="Febrero" HeaderText="Febrero" 
            SortExpression="Febrero" />
        <asp:BoundField DataField="Marzo" HeaderText="Marzo" SortExpression="Marzo" />
        <asp:BoundField DataField="Abril" HeaderText="Abril" SortExpression="Abril" />
        <asp:BoundField DataField="Mayo" HeaderText="Mayo" SortExpression="Mayo" />
        <asp:BoundField DataField="Junio" HeaderText="Junio" SortExpression="Junio" />
        <asp:BoundField DataField="Julio" HeaderText="Julio" SortExpression="Julio" />
        <asp:BoundField DataField="Agosto" HeaderText="Agosto" 
            SortExpression="Agosto" />
        <asp:BoundField DataField="Septiembre" HeaderText="Septiembre" 
            SortExpression="Septiembre" />
        <asp:BoundField DataField="Octubre" HeaderText="Octubre" 
            SortExpression="Octubre" />
        <asp:BoundField DataField="Noviembre" HeaderText="Noviembre" 
            SortExpression="Noviembre" />
        <asp:BoundField DataField="Diciembre" HeaderText="Diciembre" 
            SortExpression="Diciembre" />
    </Columns>
    <FooterStyle BackColor="White" ForeColor="#000066" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <RowStyle ForeColor="#000066" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#007DBB" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource8" runat="server" 
    ConnectionString="<%$ ConnectionStrings:IngresosConnectionString %>" 
    SelectCommand="SELECT * FROM [Anio]"></asp:SqlDataSource>
    <br />
    &nbsp;<br />
INGRESOS:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Panel ID="Panel1" runat="server" GroupingText="Agregar Ingreso" Width="900px">
    <asp:RadioButton ID="RadioButton1" runat="server" Checked="True" 
        Text="Existente" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:DropDownList ID="DropDownList2" runat="server" Width="224px">
    </asp:DropDownList>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cantidad:
    <asp:TextBox ID="TextBox2" runat="server" Width="28px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp; Valor Unitario($us):
    <asp:TextBox ID="TextBox3" runat="server" Width="34px"></asp:TextBox>
    <br />
    <asp:RadioButton ID="RadioButton2" runat="server" Text="Nuevo" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox1" runat="server" Width="225px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fecha:&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox7" runat="server" Width="89px"></asp:TextBox>
    &nbsp;
    <asp:Button ID="Button6" runat="server" Text="..." Width="25px" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Saldo: XXXX<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button4" runat="server" Text="Añadir" />
</asp:Panel>
&nbsp;<asp:GridView ID="GridView4" runat="server" 
    AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
    BorderStyle="None" BorderWidth="1px" CellPadding="3" 
    DataSourceID="SqlDataSource5" DataKeyNames="Programa" Width="462px" 
        AllowPaging="True">
    <Columns>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        <asp:BoundField DataField="Programa" HeaderText="Programa" 
            SortExpression="Programa" ReadOnly="True" />
        <asp:BoundField DataField="Ingresos" HeaderText="Ingresos" 
            SortExpression="Ingresos" />
        <asp:BoundField DataField="Egresos" HeaderText="Egresos" 
            SortExpression="Egresos" />
        <asp:BoundField DataField="Fecha" HeaderText="Fecha" 
            SortExpression="Fecha" />
        <asp:BoundField DataField="Total" HeaderText="Total" SortExpression="Total" 
            ReadOnly="True" />
    </Columns>
    <FooterStyle BackColor="White" ForeColor="#000066" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <RowStyle ForeColor="#000066" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#007DBB" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
        ConnectionString="<%$ ConnectionStrings:IngresosConnectionString %>" 
        DeleteCommand="DELETE FROM [Ingresos-Egresos] WHERE [Programa] = @Programa" 
        InsertCommand="INSERT INTO [Ingresos-Egresos] ([Programa], [Ingresos], [Egresos], [Fecha], [Total]) VALUES (@Programa, @Ingresos, @Egresos, @Fecha, @Total)" 
        SelectCommand="SELECT * FROM [Ingresos-Egresos]" 
        UpdateCommand="UPDATE [Ingresos-Egresos] SET [Ingresos] = @Ingresos, [Egresos] = @Egresos, [Fecha] = @Fecha, [Total] = @Total WHERE [Programa] = @Programa">
        <DeleteParameters>
            <asp:Parameter Name="Programa" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Programa" Type="String" />
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
            <asp:Parameter Name="Programa" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:IngresosConnectionString %>" 
        DeleteCommand="DELETE FROM [Ingresos-Egresos] WHERE [Programa] = @Programa" 
        InsertCommand="INSERT INTO [Ingresos-Egresos] ([Programa], [Ingresos], [Egresos], [Fecha], [Total]) VALUES (@Programa, @Ingresos, @Egresos, @Fecha, @Total)" 
        SelectCommand="SELECT * FROM [Ingresos-Egresos]" 
        UpdateCommand="UPDATE [Ingresos-Egresos] SET [Ingresos] = @Ingresos, [Egresos] = @Egresos, [Fecha] = @Fecha, [Total] = @Total WHERE [Programa] = @Programa">
        <DeleteParameters>
            <asp:Parameter Name="Programa" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Programa" Type="String" />
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
            <asp:Parameter Name="Programa" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Prueba1ConnectionString %>" 
    DeleteCommand="DELETE FROM [Presupuesto] WHERE [Numero] = @Numero" 
    InsertCommand="INSERT INTO [Presupuesto] ([Numero], [Ingreso], [ValorUnitario], [Cantidad], [Total]) VALUES (@Numero, @Ingreso, @ValorUnitario, @Cantidad, @Total)" 
    SelectCommand="SELECT * FROM [Presupuesto]" 
    UpdateCommand="UPDATE [Presupuesto] SET [Ingreso] = @Ingreso, [ValorUnitario] = @ValorUnitario, [Cantidad] = @Cantidad, [Total] = @Total WHERE [Numero] = @Numero">
    <DeleteParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="Numero" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource7" runat="server" 
    ConnectionString="<%$ ConnectionStrings:IngresosConnectionString %>" 
    SelectCommand="SELECT * FROM [Anio]"></asp:SqlDataSource>
<br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
EGRESOS:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Panel ID="Panel2" runat="server" GroupingText="Agregar Egreso" Width="900px">
     <asp:RadioButton ID="RadioButton3" runat="server" Checked="True" 
        Text="Existente" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:DropDownList ID="DropDownList3" runat="server" Width="224px">
    </asp:DropDownList>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cantidad:
    <asp:TextBox ID="TextBox4" runat="server" Width="39px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp; Valor Unitario($us):
    <asp:TextBox ID="TextBox5" runat="server" Width="32px"></asp:TextBox>
    <br />
    <asp:RadioButton ID="RadioButton4" runat="server" Text="Nuevo" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox6" runat="server" Width="225px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fecha:&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox8" runat="server" Width="89px"></asp:TextBox>
    &nbsp;
    <asp:Button ID="Button7" runat="server" Text="..." Width="25px" />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Saldo: XXXX&nbsp;<br /> &nbsp;
    <asp:Button ID="Button5" runat="server" Text="Añadir" />
</asp:Panel>
&nbsp;<asp:GridView ID="GridView3" runat="server" 
    AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
    BorderStyle="None" BorderWidth="1px" CellPadding="3" 
    DataSourceID="SqlDataSource9" DataKeyNames="Programa" Width="458px" 
        AllowPaging="True">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="Programa" HeaderText="Programa" ReadOnly="True" 
                SortExpression="Programa" />
            <asp:BoundField DataField="Ingresos" HeaderText="Ingresos" 
                SortExpression="Ingresos" />
            <asp:BoundField DataField="Egresos" HeaderText="Egresos" 
                SortExpression="Egresos" />
            <asp:BoundField DataField="Fecha" HeaderText="Fecha" SortExpression="Fecha" />
            <asp:BoundField DataField="Total" HeaderText="Total" ReadOnly="True" 
                SortExpression="Total" />
        </Columns>
    <FooterStyle BackColor="White" ForeColor="#000066" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <RowStyle ForeColor="#000066" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#007DBB" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource9" runat="server" 
        ConnectionString="<%$ ConnectionStrings:IngresosConnectionString %>" 
        DeleteCommand="DELETE FROM [Ingresos-Egresos] WHERE [Programa] = @Programa" 
        InsertCommand="INSERT INTO [Ingresos-Egresos] ([Programa], [Ingresos], [Egresos], [Fecha], [Total]) VALUES (@Programa, @Ingresos, @Egresos, @Fecha, @Total)" 
        SelectCommand="SELECT * FROM [Ingresos-Egresos]" 
        UpdateCommand="UPDATE [Ingresos-Egresos] SET [Ingresos] = @Ingresos, [Egresos] = @Egresos, [Fecha] = @Fecha, [Total] = @Total WHERE [Programa] = @Programa">
        <DeleteParameters>
            <asp:Parameter Name="Programa" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Programa" Type="String" />
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
            <asp:Parameter Name="Programa" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:IngresosConnectionString %>" 
        DeleteCommand="DELETE FROM [Ingresos-Egresos] WHERE [Programa] = @Programa" 
        InsertCommand="INSERT INTO [Ingresos-Egresos] ([Programa], [Ingresos], [Egresos], [Fecha], [Total]) VALUES (@Programa, @Ingresos, @Egresos, @Fecha, @Total)" 
        SelectCommand="SELECT * FROM [Ingresos-Egresos]" 
        UpdateCommand="UPDATE [Ingresos-Egresos] SET [Ingresos] = @Ingresos, [Egresos] = @Egresos, [Fecha] = @Fecha, [Total] = @Total WHERE [Programa] = @Programa">
        <DeleteParameters>
            <asp:Parameter Name="Programa" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Programa" Type="String" />
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Ingresos" Type="Double" />
            <asp:Parameter Name="Egresos" Type="Double" />
            <asp:Parameter Name="Fecha" Type="DateTime" />
            <asp:Parameter Name="Total" Type="Double" />
            <asp:Parameter Name="Programa" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Prueba1ConnectionString %>" 
    DeleteCommand="DELETE FROM [Presupuesto] WHERE [Numero] = @Numero" 
    InsertCommand="INSERT INTO [Presupuesto] ([Numero], [Ingreso], [ValorUnitario], [Cantidad], [Total]) VALUES (@Numero, @Ingreso, @ValorUnitario, @Cantidad, @Total)" 
    SelectCommand="SELECT * FROM [Presupuesto]" 
    UpdateCommand="UPDATE [Presupuesto] SET [Ingreso] = @Ingreso, [ValorUnitario] = @ValorUnitario, [Cantidad] = @Cantidad, [Total] = @Total WHERE [Numero] = @Numero">
    <DeleteParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="Numero" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
    <br />
    GRAFICA ANUAL<br />
    <br />
    <asp:Chart ID="Chart1" runat="server" datasourceid="SqlDataSource6" 
        Width="422px">
        <Series>
            <asp:Series ChartType="Line" Name="Series1" XValueMember="Total" 
                YValueMembers="Fecha">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
        ConnectionString="<%$ ConnectionStrings:IngresosConnectionString %>" 
        SelectCommand="SELECT * FROM [Ingresos-Egresos]"></asp:SqlDataSource>
    <br />
</asp:Content>

